package cn.trigram.example.designpattern.proxy.simple;


import java.util.Objects;

/**
 * 被代理对象
 */
public class TargetObject implements AbstractObject {

  private AbstractObject proxy;

  @Override
  public void setProxy(AbstractObject proxy) {

    this.proxy = proxy;
  }

  @Override
  public void method1() {

    Objects.requireNonNull(proxy, "请找代理");
    System.out.println("具体对象的方法1");
  }

}
